home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / util / cli / cliutils_mra.lha / Sources / Reboot / Reboot.a < prev   
Encoding:
Text File  |  1997-06-17  |  2.6 KB  |  106 lines

  1. ;
  2. ; $VER: Reboot.a V1.0 recoded in 100% assembly
  3. ;
  4. ; Reboot v1.0  100% assembly!
  5. ; Written by Mauro Panigada
  6. ;
  7. ; Version with confirmation (see also ColdReboot.a)
  8. ;
  9. ; (FREEWARE) It needs OS2.0+
  10. ;
  11. ; STARTED: 02/04/1996
  12. ;
  13. ; Original by Max Francis, coded in C (7368 bytes!)
  14. ; USAGE: Reboot
  15. ;
  16. ; Perform an immediate cold reboot.
  17. ;
  18. ; NOTE: This is simply a remake from "MF WBTools Reboot.c" by Max Francis,
  19. ; written in C. It is my second remake from Max Francis' program. You can
  20. ; also find DFree and DFree2, the first rough, the second better (and
  21. ; better and better than Max's C version!). The Max version often are
  22. ; copyrighted (or no?), but I note that NO PART OF CODE ARE USED OR STOLEN
  23. ; IN MY OWN VERSION (FREEWARE); I only got C-idea and converted it
  24. ; in an assembly-program.
  25. ;
  26. ; GOOD QUALITIES: My own version's shorter. Very shorter. A question for
  27. ; Max Francis: do you know that a program which only call amiga-system
  28. ; routine for a cold reset (or for getting information, as in DFree)
  29. ; longer than 1000 bytes is obsolete? Kill your C and make assembly alive
  30. ; for these simple programs... Just a suGGestion!
  31. ;
  32. ; ADDED NOTE: The same of ColdReboot, but with confirmation... So HE did!
  33. ; ADDED QUALITIES: ColdReboot + Reboot < 1000 bytes! (MY version)
  34. ; ColdReboot + Reboot > 11000 bytes!!! (HIS version)
  35. ;
  36.  
  37.         incdir    "dh0:progr/assem/include/"
  38.         include    "exec/types.i"
  39.         include    "exec/libraries.i"
  40.         include    "exec/exec_lib.i"
  41.         include    "dos/dos_lib.i"
  42.  
  43.  
  44.         bra.s    start
  45.  
  46.         dc.b    "$VER: ColdReboot v1.0 written by Mauro Panigada"
  47.         dc.b    0
  48.         even
  49.  
  50. start        move.b    d0,d6
  51.         lea    dosname(pc),a1
  52.         moveq    #36,d0
  53.         movea.l    4.w,a6
  54.         jsr    _LVOOpenLibrary(a6)
  55.         tst.l    d0
  56.         beq.s    exit0
  57.         cmp.b    #1,d6
  58.         bne.s    help_scr
  59.         move.l    d0,a6
  60.         lea    confirm(pc),a0
  61.         move.l    a0,d2
  62.         moveq    #clen,d3
  63.         jsr    _LVOOutput(a6)
  64.         move.l    d0,d1
  65.         jsr    _LVOWrite(a6)
  66.         jsr    _LVOInput(a6)
  67.         move.l    d0,d1
  68.         lea    buffer(pc),a0
  69.         move.l    a0,d2
  70.         move.l    a0,a3
  71.         moveq    #2,d3
  72.         jsr    _LVORead(a6)
  73.         cmp.b    #"Y",(a3)
  74.         bne.s    abort
  75. cr        move.l    4.w,a6
  76.         jmp    _LVOColdReboot(a6)
  77. abort        lea    ab(pc),a0
  78.         move.l    a0,d1
  79.         jsr    _LVOPutStr(a6)
  80.         bra.s    close
  81. help_scr    move.l    d0,a6
  82.         lea    help(pc),a0
  83.         move.l    a0,d1
  84.         jsr    _LVOPutStr(a6)
  85. close        move.l    a6,a1
  86.         move.l    4.w,a6
  87.         jsr    _LVOCloseLibrary(a6)
  88. exit0        rts
  89.  
  90.  
  91. dosname        dc.b    "dos.library",0
  92.         even
  93. help        dc.b    "Reboot v1.0 by Mauro Panigada",10
  94.         dc.b    "Original C version written by Max Francis",10
  95.         dc.b    "Perform a cold reboot of the system",10
  96.         dc.b    "USAGE: Reboot",10
  97.         dc.b    "(equivalent of <CTRL><A><A>",10,10,0
  98.         even
  99. confirm        dc.b    "Cold reboot? Confirm (Y/n): "
  100. clen        EQU    *-confirm
  101.         even
  102. ab        dc.b    ">> ABORTED <<",10,0
  103.         even
  104. buffer        dc.w    0
  105.  
  106.         END